<template>
	<view class="search">
		<view class="inp">
			<text class="iconfont iconsearch"></text>
			<input class="input" type="text"  v-model="name" />
			<text @click="search" class="iconfont iconsearch"></text>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			value:String
		},
		methods:{
			search(){
				this.$emit("search",this.name.trim())
			}
		},
		data() {
			return {
				
			};
		},
		computed:{
			name:{
				get:function(){
					return this.value
				},
				set:function(val){
					this.$emit("input",val)
				}
			}
		}
	}
</script>

<style lang="stylus">
	.search
		background-color #009C4E
		padding 0 20rpx
		overflow hidden
		.inp
			padding 8rpx 20rpx
			border-radius 40rpx
			display flex
			align-items center
			height 50rpx
			background-color white
			.iconsearch
				font-size 44rpx
				color #A1A1A1
			.input
				margin-left 10rpx
				flex 1
			.iconsaoma1-copy
				color #A1A1A1
				font-size 44rpx
</style>
